/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
 * @Problem 11764 - Jumping Mario
 * @author Cesar Augusto Meneses Guzman
 * @version 1.0
 * @since 18 de Febrero de 2013
 */
public class JumpingMario {
    public static void main(String args[]) throws IOException {
        // Para leer desde teclado
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // Para leer desde archivo
        //BufferedReader br = new BufferedReader(new FileReader(new File("in.txt")));
        
        int N = Integer.parseInt(br.readLine());
        int W = 0;
        int sube = 0;
        int baja = 0;
        int j = 0;
        for (int i = 0; i < N; i++) {
                W = Integer.parseInt(br.readLine());
                String data[] = br.readLine().split("[ ]+");
                sube = baja = 0;
                for (j = 0; j < W-1; j++) {
                    if ( Integer.parseInt(data[j + 1]) > Integer.parseInt(data[j]) )
                        sube++;
                    if ( Integer.parseInt(data[j + 1]) < Integer.parseInt(data[j]) )
                        baja++;
                }
                System.out.println("Case " + (i + 1) + ": " + sube + " " + baja);
        }
    }
}